<?php

class Zend_View_Helper_Available extends Zend_View
{	
	public function Available( $pre , $item , $locale, $config) {
		$tlumaczenia['helper_available_0'] = "chwilowy brak";
		$tlumaczenia['helper_available_5'] = "niski stan magazynowy";
		$tlumaczenia['helper_available_10'] = "dostępny";
		$tlumaczenia['helper_preorder'] = "preorder";
//		var_dump($tablica->_translator->_translate['pl']['helper_available_0']);
//		exit;
		$return = '<span class="';
		if($pre=="preorder"){
			$item = $pre ; 
		}
		switch($item)
		{
			case '0':
				$return .='orange">'.$tlumaczenia['helper_available_0'].'</span>';
				break;
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
				$return .='green_yellow">'.$tlumaczenia['helper_available_5'].'</span>';
				break;
			case 'preorder':
				$return .='red">'.$tlumaczenia['helper_preorder'].'</span>';
				break;
			default:
				$return .='green">'.$tlumaczenia['helper_available_10'].'</span>';
				break;
		}
		return $return;
	}
}